#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: tpf_api_requests.py 
@version:
@time: 2022/05/09 
"""
from TapClientCore.T05_TM_feature.v2.TMF07_modules.api_requests import TMFAPIRequests


class TPFAPIRequests(TMFAPIRequests):

    # query
    def api_query(self, path, payload=None):
        return self._api_query_by_where(path, payload).get('data')

    # query2
    def api_query2(self, path, pk):
        return self._api_query_by_id(path, pk).get('data')

    # query3
    def api_query3(self, path, _filter=None):
        return self._api_query_by_filter(path, _filter).get('data')

    # 新增
    def api_insert(self, path, data):
        return self._api_insert(path, data)

    # 修改
    def api_update(self, path, pk, payload):
        return self._api_update_by_pk_1(path, pk, payload)

    # 删除
    def api_delete(self, path, pk):
        return self._api_delete_by_pk_1(path, pk)

    # count
    def api_count(self, path):
        return self._api_count(path).get('total').get('count')
